import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'login',
      chineseName: '登录页',
      component: () => import(/* webpackChunkName: "Login" */ '@/views/Login.vue'),//分模块进行打包  Login 独立模块
    },
    {
      path: '/home',
      // name: 'home', // 要有默认子路由，那父路由的名字name得去掉,path: '/' 的路由是默认子路由，它不能有name属性
      chineseName: '后台主页',
      component: () => import(/* webpackChunkName: "Home" */ '@/views/Home.vue'),//分模块进行打包  Home 模块
      children: [
        {
          path: '/',
          name: 'echarts',
          chineseName: '百度图表展示页',
          component: () => import(/* webpackChunkName: "Home" */ '@/components/Home/main.vue'),
        },
      ]
    },
    {
      path: '/permissions',
      name: 'permissions',
      chineseName: '系统',
      component: () => import(/* webpackChunkName: "permissions" */ '@/views/Home.vue'),
      children: [
        {
          path: 'administratorList',
          name: 'administratorList',
          chineseName: '管理员列表',
          component: () => import(/* webpackChunkName: "permissions" */ '@/components/systemSettings/permissions/administratorList.vue'),
        },
        {
          path: 'roleManagement',
          name: 'roleManagement',
          chineseName: '角色管理',
          component: () => import(/* webpackChunkName: "permissions" */ '@/components/systemSettings/permissions/roleManagement.vue'),
        },
        {
          path: 'accessResources',
          name: 'accessResources',
          chineseName: '权限资源管理',
          component: () => import(/* webpackChunkName: "permissions" */ '@/components/systemSettings/permissions/accessResources.vue'),
        },
        {
          path: 'adminAddMCA',
          name: 'adminAddMCA',
          chineseName: 'admin添加MCA',
          component: () => import(/* webpackChunkName: "permissions" */ '@/components/systemSettings/permissions/adminAddMCA.vue'),
        },
      ]
    },

    {
      path: '*',
      name: '404',
      component: () => import(/* webpackChunkName: "404-page" */ '@/views/404.vue'),//分模块进行打包  404-page 独立模块
    }
    /*{
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/!* webpackChunkName: "about" *!/ './views/About.vue')
    }*/
  ]
})
